package org.springmvc.mybatis.pagination;


import java.io.Serializable;
import java.util.List;

/**
 * 查询返回的每一页的数据封装接口
 *
 * @author tangjialin on 2018-07-26.
 */
public class Page<E> implements Serializable {
    /** */
    private static final long serialVersionUID = 1L;
    /** 记录总数 */
    private long total;
    /** 响应客户端的数据集 */
    private List<E> items;
    /** 响应客户端的统计 */
    private List<E> footers;

    public Page(Pageable pageable, List<E> items) {
        this.total = pageable.getTotal();
        this.items = items;
    }

    public Page(Pageable pageable, List<E> items, List<E> footers) {
        this.total = pageable.getTotal();
        this.items = items;
        this.footers = footers;
    }

    public Page(long total, List<E> items) {
        this.total = total;
        this.items = items;
    }

    public Page(long total, List<E> items, List<E> footers) {
        this.total = total;
        this.items = items;
        this.footers = footers;
    }

    public long getTotal() {
        return total;
    }

    public List<E> getItems() {
        return items;
    }

    public List<E> getFooters() {
        return footers;
    }
}
